<html>
<head>
	<meta name="Keywords" content="">
	<meta name="Description" content="">
	<title>addChild</title>
</head>
<body>

	<ul id="ul1">
		<li>li1</li>
		<li>li2</li>
		<li>li3</li>
	</ul>
	<hr/>
	<input type="button" value="add" onclick="add();" />

	<script type="text/javascript">

		var num = 4;

		function add() {
			var li = document.createElement("li");
			var text = document.createTextNode("li"+num);
			li.appendChild(text);
			var ul = document.getElementById("ul1");
			ul.appendChild(li);
			num++;
		}

	</script>

</body>
</html>